#include <stdio.h>

int findNum1(int a);

int main() {
	int arr[10] = {1, 1, 2, 2, 3, 3, 4, 4, 5, 6};
	int len = sizeof(arr) / sizeof(arr[0]);

	int ret = arr[0];
	for (int i = 1; i < len; i++) {
		ret ^= arr[i];
	}

	int k = findNum1(ret);

	int num1 = 0, num2 = 0;
	for (int i = 0; i < len; i++) {
		if ((arr[i] >> k) & 1 == 1) {
			num1 ^= arr[i];
		} else {
			num2 ^= arr[i];
		}
	}

	printf("%d %d\n", num1, num2);
	return 0;
}

int findNum1(int a) {
	int k = 1;
	int ret = a & 1;
	while (ret != 1 && k < 32) {
		a >>= 1;
		ret = a & 1;
		k++;
	}
	return k;
}